package scripting;

import client.MapleClient;
import server.MaplePortal;

public class PortalPlayerInteraction extends AbstractPlayerInteraction {
    private MaplePortal portal;

    public PortalPlayerInteraction(MapleClient c, MaplePortal portal) {
        super(c);
        this.portal = portal;
    }

    public MaplePortal getPortal() {
        return this.portal;
    }

    public String getPortalName() {
        return this.portal.getName();
    }

    public void inFreeMarket() {
        if (this.getPlayer().getLevel() >= 10) {
            this.saveLocation("FREE_MARKET");
            this.playPortalSE();
            this.warp(910000000, "st00");
        } else {
            this.playerMessage(5, "你需要10级才可以进入自由市场");
        }
    }

    @Override
    public void spawnMonster(int id) {
        this.spawnMonster(id, 1, this.portal.getPosition());
    }

    @Override
    public void spawnMonster(int id, int qty) {
        this.spawnMonster(id, qty, this.portal.getPosition());
    }
}
